#include "ChatDialog/listitembase.h"

#include <QStyleOption>
#include <QPainter>

ListItemBase::ListItemBase(QWidget *parent)
    : QWidget{parent}
{}

// 设置 / 获取 ListItemBase 的类型
void ListItemBase::SetItemType(ListItemType itemType){
    _itemType = itemType;
}
ListItemType ListItemBase::GetItemType(){
    return _itemType;
}

// 继承了QWidget,我们想实现样式更新，需要重写paintEvent
void ListItemBase::paintEvent(QPaintEvent* event){
    QStyleOption opt;
    opt.init(this);
    QPainter p(this);
    style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
